/*
 *
 * System2 Simulation Framework
 * Copyright (C) 2011 - 2012 Jacob Dawid
 * jacob.dawid@googlemail.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef PACKAGE_H
#define PACKAGE_H

#include <QString>
#include <QList>
#include <QMap>
#include "component.h"

namespace System2 {
    /**
      * \class Package
      * \author Jacob Dawid <jacob.dawid@googlemail.com>
      * \date 12.01.2012
      */
    class Package {
    public:
        Package();
        ~Package();

        void storeDynamicLibraryHandle(void *dynamicLibraryHandle);

        virtual QString displayName() = 0;
        virtual QString signature() = 0;

        QList<Component*> components();
        QList<QString> componentSignatures();
        Component* componentBySignature(QString signature);

    protected:
        void addComponent(Component *component);
        QMap<QString, Component*> m_components;

    private:
        void *m_dynamicLibraryHandle;
    };
}
#endif // PACKAGE_H
